<?php
class Test_bk extends MY_Controller{
	
	function __construct()
	{
		parent::__construct();
		if(!$this->admin || $this->admin->status != 1) redirect('login');
		$this->authority->initialize($this->admin);
	}
	
	function index()
	{
		
		$this->load->view('default/test');
	}
	
	function add()
	{
		
		if(can('create','Admin')){
		$data = array('firstname'=>'bob','lastname'=>'hao','email'=>'info@betalife.be','role'=>'client');
		admin::create($data);
		}else{
			echo "can't";
		}	
	}
	
	function delete()
	{
		if(can('delete','Admin')){
			$item = admin::find_by_id(2);
			$item->delete();
		}else{
			echo "can't";
		}
	}
	
}
